package com.xunfang.dead;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

//@Component
public class NormalListener {

    /**
     * 消息确认、消费者可靠性保证
     */
//    @RabbitListener(queues = "normal.queue")
//    public void handle(String text, Channel channel, Message message) throws IOException {
//
//        MessageProperties properties = message.getMessageProperties();
//        long deliveryTag = properties.getDeliveryTag();
//
//        //消息拒绝  回到 queue中
//        //queue 中绑定了死信队列
//        //死信消费者消费
//        channel.basicReject(deliveryTag, false);
//    }
}